package com.caiyouxi.app.controller;

import com.caiyouxi.common.bean.ResData;
import com.caiyouxi.common.control.BaseController;
import com.caiyouxi.common.util.Log;
import com.caiyouxi.app.model.AppVersionBean;
import com.caiyouxi.app.service.AppVersionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


/**
 * weichangyong
 * APP应用相关
 */
@RestController
@RequestMapping("/caiyouxi/")
public class AppController extends BaseController {


    @Autowired
    private AppVersionService appVersionService;


    /**
     * 获取联运SDK版本信息
     * @param request
     * @param response
     * @param bean
     * @return
     */
    @RequestMapping("get_app_sdk_config")
    public ResData get_app_sdk_config(HttpServletRequest request, HttpServletResponse response, @RequestBody AppVersionBean bean) {
        Log.i("获取联运SDK版本信息");

        return  appVersionService.get_app_version_config(bean);
    }

        /**
     * 添加app配置信息
     * @param request
     * @param response
     * @param bean
     * @return
     */
    @RequestMapping("add_app_sdk_config")
    public ResData add_app_sdk_config(HttpServletRequest request, HttpServletResponse response, AppVersionBean bean) {

        appVersionService.add_app_sdk_config(bean);
        return success(null);

    }


}
